<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body{
            padding-bottom: 800px;
            padding-left: 30px;
        }
        .cbox{
            border: 1px solid #999;
            padding: 20px;
            margin: 10px 0px;
        }
    </style>
</head>
<body>
    <div id="app">
        <h4>根组件</h4>
        <comp-a>
            <p>分发文本</p>
        </comp-a>
        <comp-a>
            <comp-b></comp-b>
        </comp-a>
        <comp-a>
            <comp-a>
                <comp-a>
                    <comp-a></comp-a>
                </comp-a>
            </comp-a>
        </comp-a>
    </div>
    <script type="module">
        // 加载 Vue3 的ESM 模块文件
        import { createApp } from "../../assets/vue3/vue.esm-browser.js"
        const CompA = {
            name:"CompA",
            template:`
                <div class="cbox">
                    <h4>组件A</h4>
                    <slot></slot>
                </div>
            `
        }
        const CompB = {
            name:"CompB",
            template:`
                <div class="cbox">
                    <h4>组件B</h4>
                </div>
            `
        }
        createApp({
            components: {
                CompA,CompB
            },
            data(){
                return {
                    
                }
            }
        }).mount("#app")
    </script>
</body>
</html>